var reques = require('../../utils/util.js');
// pages/setgrjj/setgrjj.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    isgrjj: false,
    num: 0,
    intro: null,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  inputgrjj: function (e) {
    var that = this;
    if (e.detail.cursor > 0) {
      that.setData({
        isgrjj: true,
        num: e.detail.cursor,
        intro: e.detail.value
      })
    } else {
      that.setData({
        isgrjj: false,
        num: 0,
      })
    }
  },

  save: function () {
    var that = this;
    var url = getApp().globalData.URL + 'user/upsearPer';
    var para = {
      id: getApp().globalData.accountINFO.id,
      introduction: that.data.intro,
    }
    reques.gethttp(url, para)
      .then((res) => {
        if (res.data.code == 1) {
          wx.navigateBack({})
        }
      })
      .catch((errMsg) => {
        console.log(errMsg);
      })
  },
})